package com.xjgc.controller;

import com.xjgc.rest.ao.MsiRealAO;
import com.xjgc.server.MsiRealHandle;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author: 小逗号
 * @date: 2023-12-1
 * @description:
 * @since:
 */
@Slf4j
@Api(tags = "采购-即时请求SAP")
@RestController
@RequestMapping("/real/sap/purchase")
public class RealSapPurchase {
    private static final String SERVER_CODE = "RealTaskPurchase";

    @Resource
    private MsiRealHandle msiRealHandle;


    @ApiOperation("物料主数据扩展")
    @PostMapping("/mm02")
    public Result<?> mm02(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "mm02", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }

    @ApiOperation("供应商主数据扩充")
    @PostMapping("/xk02")
    public Result<?> xk02(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "xk02", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }

    @ApiOperation("采购入库")
    @PostMapping("/mm009")
    public Result<?> mm009(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "mm009", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }

}
